Spin the wheel: a Jlerts custom widget
======================================

A game-show prize wheel. It spins fast, then slows down and lands on a random challenge. The pointer clicks on
every slice as it passes (a rattle when it's fast, slow loud clicks at the end), a drum roll builds up as it slows,
and when it stops there's a crash, "ding ding", "Nice!", a crowd cheer with clapping, flashing lights and a WINNER!
pop-up with confetti.

Add it to Jlerts
1. Unzip this folder somewhere it can stay (for example Documents\Jlerts widgets\Spin the wheel).
2. In Jlerts: Widgets -> + New widget -> Custom widget (HTML / CSS / JS).
3. Widget folder -> Choose folder... and pick this folder. Its settings appear underneath.
4. Drag it onto your overlay (700 x 760). To change its size, drag the edges of its box on the canvas.

Your challenges
- Paste them into "Challenges" in its settings, one per line (straight from Notepad or Discord).
- Add  | 3  to the end of one to make it 3 times as likely, or  | 0.5  for half as likely.
- With lots of challenges, the wheel shows a random handful each spin (12 by default, 40 at most), so it stays readable.
- "Take a challenge off once it's landed on" means no repeats until you type !wheel reset.

Spinning it
- !spin in chat (you and mods by default; change who in its settings).
- A channel point redeem: put the redeem's exact name in its settings.
- By itself during a subathon: e.g. every 5 subs, every 500 bits or every 10 in tips.
- Spins asked for while it's spinning wait their turn.

Chat commands for you and your mods
  !wheel add Eat a lemon     add a challenge
  !wheel remove 3            take one off (by number, or by its words)
  !wheel reset               bring back the ones that were taken off
  !wheel spin                spin it

Sounds: Game show, Soft, Clicks only or Off, a volume, and tick boxes for the drum roll, ding ding, "Nice!", crowd
cheer, clapping and fanfare. In OBS, its sound comes through the browser source (tick "Control audio via OBS" to give
it its own slider).

Your own sounds: every sound is a .wav file in the sounds folder. Swap any of them for your own, keeping its name:
  click.wav     one click of the pointer (plays on every slice)
  drumroll.wav  a 1-second loop, played over the slow-down (it gets louder by itself)
  crash.wav     the hit and cymbal as it stops
  ding.wav      ding ding
  nice.wav      the "Nice!" voice line (a Kokoro voice with a retro crunch)
  cheer.wav     the crowd cheer
  clapping.wav  the clapping
  fanfare.wav   the fanfare (off by default)
.mp3 works too if you change the name in script.js (search for .wav).

Change it
  widget.json  its name and size when it's added
  fields.json  the settings people can change without code
  index.html   the wheel's rim, hub and pointer (SVG)
  style.css    the title, lights, flash and winner pop-up
  script.js    the slices, the spin, the sounds and the commands
After changing a file, refresh the overlay in OBS (right-click it -> Refresh).

Free to use and change for your streams.
